package cn.edu.scau.cmi.zhengweibo.client;

import java.util.Scanner;

import cn.edu.scau.cmi.zhengweibo.abstractFactory.domainAbstractClass.ConsumerGetmeat;
import cn.edu.scau.cmi.zhengweibo.abstractFactory.factory.AbstractFactory;
import cn.edu.scau.cmi.zhengweibo.abstractFactory.factory.AonongFactory;
import cn.edu.scau.cmi.zhengweibo.abstractFactory.factory.TianbangFactory;
import cn.edu.scau.cmi.zhengweibo.abstractFactory.factory.WensFactory;

public class AbstractFactoryClient {

	public static void main(String[] args) {
		
//(1) 选择品牌
		System.out.println("请输入你想买的肉类品牌:");
		Scanner scanner = new Scanner(System.in);  
		String brandKind = scanner.next();  
		AbstractFactory factory=null;
		switch(brandKind){
		case "wens": 
			factory=new WensFactory();
			break;
		case "aonong": 
			factory=new AonongFactory();
			break;
		case "tianbang": 
			factory=new TianbangFactory();
			break;
		default:System.out.println("对不起，输入有误！");
		
		}
		
//		（2）选择产品
		
		System.out.println("请选择你想买的肉类:");
		String productType = scanner.next();  
		ConsumerGetmeat meat=null;
		switch(productType) {
		case "beef": 
			meat=factory.createBeef();
			break;
		case "pork": 
			meat=factory.createPork();
			break;
		case "chicken": 
			meat=factory.createChicken();
			break;
		default:System.out.println("对不起，输入有误！");
		
		}
		if(meat!=null) {
			meat.getMeat();
		}
		
	}
}